<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>DropdownlistAPI</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrapEx.css">
    <link rel="stylesheet" href="../js/prettyPrint/css/prettify.css">
    <link rel="stylesheet" href="api.css">


    <script src="../js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../js/prettyPrint/js/prettify.js"></script>
</head>

<body onload="prettyPrint()">
    <div class="container-fluid">
        <div class="">
            <div class="span12">
                <h1>属性</h1>
                <hr/>
            </div>
            <div class="">
                <h3>bsEx.Dropdownlist </h3>
                <div>
                    <h3>注</h3>
                    <pre class="prettyprint"><code>表单dropdownlist(下拉)控件来自<a href="http://silviomoreto.github.io/bootstrap-select/" target="_black">bootstrap-select</a>插件(没有修改插件源码);</code> </pre>
                    <hr>
                </div>
                添加引用
                <pre class="prettyprint linenums"><code> &lt;link rel=&quot;stylesheet&quot; href=&quot;../../css/bootstrap.min.css&quot;&gt;
 &lt;link rel=&quot;stylesheet&quot; href=&quot;../../css/from/bootstrap-datetimepicker.min.css&quot;&gt;
 &lt;link rel=&quot;stylesheet&quot; href=&quot;../../css/from/bootstrap-select.css&quot;&gt;
 &lt;link rel=&quot;stylesheet&quot; href=&quot;../../css/bootstrapEx.css&quot;&gt;
 
 &lt;script src=&quot;../../js/jquery-1.9.1.min.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;../../js/from/global.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;../../js/from/jquery.smart-form.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;../../js/from/bootstrap-datetimepicker.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;../../js/from/bootstrap-datetimepicker.zh-CN.js&quot; charset=&quot;UTF-8&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;../../js/from/bootstrap-select.js&quot; charset=&quot;UTF-8&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;../../js/bootstrap.min.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;../../js/bootstrapEx2.0.js&quot;&gt;&lt;/script&gt;</code></pre>
                <p>继承自bsEx.ui.base:</p>
                <div class="table">
                    <div class="row title">
                        <div class="col-xs-2 col-sm-2">属性名称</div>
                        <div class="col-xs-2 col-sm-2">类型</div>
                        <div class="col-xs-3 col-sm-3">默认值</div>
                        <div class="col-xs-5 col-sm-5">备注说明</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">id</div>
                        <div class="col-xs-2 col-sm-2">string</div>
                        <div class="col-xs-3 col-sm-3">bsEx.getId()</div>
                        <div class="col-xs-5 col-sm-5">控件ID</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">renderto</div>
                        <div class="col-xs-2 col-sm-2">string</div>
                        <div class="col-xs-3 col-sm-3">无(必填)</div>
                        <div class="col-xs-5 col-sm-5">绘制到容器的对象或选择器</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">type</div>
                        <div class="col-xs-2 col-sm-2">string</div>
                        <div class="col-xs-3 col-sm-3">Dropdownlist</div>
                        <div class="col-xs-5 col-sm-5">控件类型</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">firstInit</div>
                        <div class="col-xs-2 col-sm-2">boolean</div>
                        <div class="col-xs-3 col-sm-3">false</div>
                        <div class="col-xs-5 col-sm-5">第一次加载是否完成</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">language</div>
                        <div class="col-xs-2 col-sm-2">bsEx.language</div>
                        <div class="col-xs-3 col-sm-3">bsEx.language.zhCN</div>
                        <div class="col-xs-5 col-sm-5">当前语言包</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3 col-sm-3">cls</div>
                        <div class="col-xs-3 col-sm-3">string</div>
                        <div class="col-xs-3 col-sm-3">""</div>
                        <div class="col-xs-3 col-sm-3">自定义样式 在绘制之前会在renderto加入该样式</div>
                    </div>
                </div>
                <p>控件实例属性:</p>
                <div class="table">
                    <div class="row title">
                        <div class="col-xs-2 col-sm-2">属性名称</div>
                        <div class="col-xs-2 col-sm-2">类型</div>
                        <div class="col-xs-3 col-sm-3">默认值</div>
                        <div class="col-xs-5 col-sm-5">备注说明</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">data</div>
                        <div class="col-xs-2 col-sm-2">数组[]</div>
                        <div class="col-xs-3 col-sm-3">[]</div>
                        <div class="col-xs-5 col-sm-5">数据集合</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">treedata</div>
                        <div class="col-xs-2 col-sm-2">数组[]</div>
                        <div class="col-xs-3 col-sm-3">[]</div>
                        <div class="col-xs-5 col-sm-5">树级数据集合</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">idfield</div>
                        <div class="col-xs-2 col-sm-2">string</div>
                        <div class="col-xs-3 col-sm-3">id</div>
                        <div class="col-xs-5 col-sm-5">数据集合中绑定到value的字段</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">textfield</div>
                        <div class="col-xs-2 col-sm-2">string</div>
                        <div class="col-xs-3 col-sm-3">name</div>
                        <div class="col-xs-5 col-sm-5">数据集合中绑定到name的字段</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">parentfield</div>
                        <div class="col-xs-2 col-sm-2">string</div>
                        <div class="col-xs-3 col-sm-3">pId</div>
                        <div class="col-xs-5 col-sm-5">树级数据集合中绑定到父级ID的字段</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">tree</div>
                        <div class="col-xs-2 col-sm-2">boolean</div>
                        <div class="col-xs-3 col-sm-3">false</div>
                        <div class="col-xs-5 col-sm-5">是否启用树级显示</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">treelevel</div>
                        <div class="col-xs-2 col-sm-2">boolean</div>
                        <div class="col-xs-3 col-sm-3">false</div>
                        <div class="col-xs-5 col-sm-5">是否自动勾选子集 启动树级显示并且多选时生效</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">disabled</div>
                        <div class="col-xs-2 col-sm-2">boolean</div>
                        <div class="col-xs-3 col-sm-3">false</div>
                        <div class="col-xs-5 col-sm-5">是否禁用</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">multiple</div>
                        <div class="col-xs-2 col-sm-2">boolean</div>
                        <div class="col-xs-3 col-sm-3">false</div>
                        <div class="col-xs-5 col-sm-5">是否多选</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">initval</div>
                        <div class="col-xs-2 col-sm-2">数组[]</div>
                        <div class="col-xs-3 col-sm-3">[]</div>
                        <div class="col-xs-5 col-sm-5">初始值，可以为多个 多选为true时生效</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">search</div>
                        <div class="col-xs-2 col-sm-2">boolean</div>
                        <div class="col-xs-3 col-sm-3">true</div>
                        <div class="col-xs-5 col-sm-5">是否显示搜索框</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">showclear</div>
                        <div class="col-xs-2 col-sm-2">boolean</div>
                        <div class="col-xs-3 col-sm-3">true</div>
                        <div class="col-xs-5 col-sm-5">是否显示清空按钮</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">noneSelectedText</div>
                        <div class="col-xs-2 col-sm-2">string</div>
                        <div class="col-xs-3 col-sm-3">language.selectnoneText()|"---请选择---"</div>
                        <div class="col-xs-5 col-sm-5">没有选择时显示的文字</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">deselectAllText</div>
                        <div class="col-xs-2 col-sm-2">string</div>
                        <div class="col-xs-3 col-sm-3">language.deselectAllText()|"清空"</div>
                        <div class="col-xs-5 col-sm-5">清空按钮文字</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">selectAllText</div>
                        <div class="col-xs-2 col-sm-2">string</div>
                        <div class="col-xs-3 col-sm-3">language.selectAllText()|"全选"</div>
                        <div class="col-xs-5 col-sm-5">全选按钮文字</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">optdisabledfn</div>
                        <div class="col-xs-2 col-sm-2">function</div>
                        <div class="col-xs-3 col-sm-3">function (d) { return false; }</div>
                        <div class="col-xs-5 col-sm-5">遍历每个下拉项如果改方法返回true 该项将被 disabled</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2 col-sm-2">removedatafn</div>
                        <div class="col-xs-2 col-sm-2">function</div>
                        <div class="col-xs-3 col-sm-3">function (d) { return false; }</div>
                        <div class="col-xs-5 col-sm-5">遍历每个下拉项如果该方法返回true 该项将被删除</div>
                    </div>
                </div>
                <h4>示例</h4>
                <pre class="prettyprint linenums"><code>略</code> </pre>
                <hr/>
            </div>
        </div>
        <div class="">
            <div class="span12">
                <h1>方法</h1>
                <hr/>
            </div>
            <div class="">
                <h3>init() <small>返回类型: 无</small></h3>
                <p>绘制方法</p>
                <h4>示例</h4>
                <pre class="prettyprint linenums"><code>略</code> </pre>
                <hr/>
            </div>
            <div class="">
                <h3>setvalue(vals) <small>返回类型: 无</small></h3>
                <p>设置选择项</p>
                <div class="table">
                    <div class="row title">
                        <div class="col-xs-3 col-sm-3">参数名称</div>
                        <div class="col-xs-3 col-sm-3">类型</div>
                        <div class="col-xs-3 col-sm-3">默认值</div>
                        <div class="col-xs-3 col-sm-3">备注说明</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3 col-sm-3">vals</div>
                        <div class="col-xs-3 col-sm-3">数组[]</div>
                        <div class="col-xs-3 col-sm-3">[]必填</div>
                        <div class="col-xs-3 col-sm-3">选择的值结合</div>
                    </div>
                </div>
                <h4>示例</h4>
                <pre class="prettyprint linenums"><code>略</code> </pre>
                <hr/>
            </div>
            <div class="">
                <h3>getval() <small>返回类型: []</small></h3>
                <p>返回选择项值(idfield值)的集合</p>
                <h4>示例</h4>
                <pre class="prettyprint linenums"><code>略</code> </pre>
                <hr/>
            </div>
            <div class="">
                <h3>getvaldata() <small>返回类型: []</small></h3>
                <p>返回选择项的集合</p>
               <h4>示例</h4>
               <pre class="prettyprint linenums"><code>略</code> </pre>
               <hr/>
            </div>
            <div class="">
                <h3>setdisabled(b) <small>无</small></h3>
                <p>设置是否不可用</p>
                <div class="table">
                    <div class="row title">
                        <div class="col-xs-3 col-sm-3">参数名称</div>
                        <div class="col-xs-3 col-sm-3">类型</div>
                        <div class="col-xs-3 col-sm-3">默认值</div>
                        <div class="col-xs-3 col-sm-3">备注说明</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3 col-sm-3">b</div>
                        <div class="col-xs-3 col-sm-3">boolean</div>
                        <div class="col-xs-3 col-sm-3">无(必填)</div>
                        <div class="col-xs-3 col-sm-3">为true时下拉框不可用</div>
                    </div>
                </div>
               <h4>示例</h4>
               <pre class="prettyprint linenums"><code>略</code> </pre>
               <hr/>
            </div>
            <div class="">
                <h3>selectpicker(k, v) <small>无</small></h3>
                <p>继承bootstrap-select方法</p>
               <h4>示例</h4>
               <pre class="prettyprint linenums"><code>bsEx.ui.select1.selectpicker('refresh');//刷新</code> </pre>
               <hr/>
            </div>
        </div>
        <div class="">
            <div class="span12">
                <h1>事件</h1>
                <hr/>
            </div>
            <div class="">
                <h3>beforeinit(t) <small>返回类型: 无</small></h3>
                <p>绘制前事件，执行init()后第一个执行，可以对实例进行操作影响init执行</p>
                <div class="table">
                    <div class="row title">
                        <div class="col-xs-3 col-sm-3">参数名称</div>
                        <div class="col-xs-3 col-sm-3">类型</div>
                        <div class="col-xs-3 col-sm-3">默认值</div>
                        <div class="col-xs-3 col-sm-3">备注说明</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3 col-sm-3">t</div>
                        <div class="col-xs-3 col-sm-3">object</div>
                        <div class="col-xs-3 col-sm-3">无</div>
                        <div class="col-xs-3 col-sm-3">控件实例</div>
                    </div>
                </div>
                <h4>示例</h4>
                <pre class="prettyprint linenums"><code>略</code> </pre>
                <hr/>
            </div>
            <div class="">
                <h3>inited(t) <small>返回类型: 无</small></h3>
                <p>绘制后事件，执行init()后执行</p>
                <div class="table">
                    <div class="row title">
                        <div class="col-xs-3 col-sm-3">参数名称</div>
                        <div class="col-xs-3 col-sm-3">类型</div>
                        <div class="col-xs-3 col-sm-3">默认值</div>
                        <div class="col-xs-3 col-sm-3">备注说明</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3 col-sm-3">t</div>
                        <div class="col-xs-3 col-sm-3">object</div>
                        <div class="col-xs-3 col-sm-3">无</div>
                        <div class="col-xs-3 col-sm-3">控件实例</div>
                    </div>
                </div>
                <h4>示例</h4>
                <pre class="prettyprint linenums"><code>略</code> </pre>
                <hr/>
            </div>
            <div class="">
                <h3>selectchanged(vals) <small>返回类型: 无</small></h3>
                <p>选择值改变后事件，执行init()后执行</p>
                <div class="table">
                    <div class="row title">
                        <div class="col-xs-3 col-sm-3">参数名称</div>
                        <div class="col-xs-3 col-sm-3">类型</div>
                        <div class="col-xs-3 col-sm-3">默认值</div>
                        <div class="col-xs-3 col-sm-3">备注说明</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3 col-sm-3">vals</div>
                        <div class="col-xs-3 col-sm-3">数组[]</div>
                        <div class="col-xs-3 col-sm-3">[]必填</div>
                        <div class="col-xs-3 col-sm-3">选择的值结合</div>
                    </div>
                </div>
                <h4>示例</h4>
                <pre class="prettyprint linenums"><code>略</code> </pre>
                <hr/>
            </div>
        </div>
</body>
<script>
      $(document).ready(function () {
          $.each($(".table").find(".row div"),function(i,t){
              $(t).removeClass("col-xs-3 col-sm-3");
          });
          $.each($(".table").find(".row"),function(i,t){
              $(t).find("div").eq(0).addClass("col-xs-2 col-sm-2");
              $(t).find("div").eq(1).addClass("col-xs-2 col-sm-2");
              $(t).find("div").eq(2).addClass("col-xs-3 col-sm-3");
              $(t).find("div").eq(3).addClass("col-xs-5 col-sm-5");
          });
      });
</script>
</html>